<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>声明数组</title>
</head>

<body>
  <script>
    let arr = [7, 8, 9, 10, 11]
    console.log(arr);
    let arr1 = new Array(1, 2, 3, 4)

    // 求最大值
    let max = arr[0]
    let min = arr[0]
    for (let i = 0; i < arr.length; i++) {
      if (max < arr[i]) {
        max = arr[i]
      }
      if (min > arr[i]) {
        min = arr[i]
      }
    }
    document.write('最大值是' + max)
    document.write('最小值是' + min)


  </script>
</body>

</html>